# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-moviepy
pkgname=('python2-moviepy' 'python-moviepy')
_pkgname=moviepy
pkgver=2.2.1
_pyver=3.13
pkgrel=1
pkgdesc='Video editing with Python'
arch=('any')
url='https://pypi.org/project/moviepy/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('493e81a5a2117cc0123828eed072f92af5ee57b8a293578e8c25236eedc4aea8739435cb342e4fe6e619f3917459d83858e92b343cdfd8729d2e3611d3731649')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-moviepy() {
  depends=('python2' 'python2-decorator' 'python2-imageio'
           'python2-imageio-ffmpeg' 'python2-tqdm' 'python2-numpy'
           'python2-requests' 'python2-proglog')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build

  rm -rf "$pkgdir/usr/lib/python2.7/site-packages/tests"
}

package_python-moviepy() {
  depends=('python' 'python-decorator' 'python-imageio'
           'python-imageio-ffmpeg' 'python-tqdm' 'python-numpy'
           'python-requests' 'python-proglog')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/tests"
}

